package net.xcrane.xmpp.tools;

import java.net.InetAddress;

import org.jivesoftware.smack.AbstractXMPPConnection;
import org.jivesoftware.smack.ConnectionConfiguration.DnssecMode;
//import org.jivesoftware.smack.ConnectionConfiguration.DnssecMode;
import org.jivesoftware.smack.SmackConfiguration;
import org.jivesoftware.smack.tcp.XMPPTCPConnection;
import org.jivesoftware.smack.tcp.XMPPTCPConnectionConfiguration;

public class app {

	public static void main(String[] args) {
		SmackConfiguration.addDisabledSmackClass("org.jivesoftware.smack.util.dns.minidns.MiniDnsResolver");
		XMPPTCPConnectionConfiguration config = null;
		AbstractXMPPConnection xmppCnn = null;
			
		try {
			
			config = XMPPTCPConnectionConfiguration.builder()
					.setDebuggerEnabled(true)
					.setXmppDomain("sun")
					.setHostAddress(InetAddress.getByName("snowing-MBP"))
					.setSecurityMode(XMPPTCPConnectionConfiguration.SecurityMode.disabled)
					.setPort(5222)
					.setDnssecMode(DnssecMode.disabled)
					.build();
			
			xmppCnn = new XMPPTCPConnection(config);
			xmppCnn.connect();
			
			xmppCnn.login("snowing", "snowing");
		} catch (Exception e1) {
			e1.printStackTrace();	
		}

	}

}
